package com.cskaoyan.service.wxorder;

import com.cskaoyan.bean.bo.wxorder.WxFeedbackBo;
import com.cskaoyan.bean.po.wxorder.MarketFeedback;
import com.cskaoyan.mapper.wxorder.MarketFeedbackMapper;
import com.cskaoyan.util.common.BeanTransfer;
import com.cskaoyan.util.common.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author Zhang Tao
 * @version 1.0.0
 * @description
 * @date since 2022-07-19 20:51
 */
@Service
public class WxFeedBackImpl implements WxFeedbackService {

    @Autowired
    MarketFeedbackMapper feedbackMapper;

    @Transactional
    @Override
    public void updateFeedBack(WxFeedbackBo wxFeedback) {
        MarketFeedback marketFeedback = new MarketFeedback();
        MarketFeedback transfer=null;
        try {
            transfer = (MarketFeedback) BeanTransfer.transfer(wxFeedback, marketFeedback);
            transfer.setAddTime(DateUtils.time());
            transfer.setUpdateTime(DateUtils.time());
            transfer.setDeleted(false);
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        feedbackMapper.insertSelective(transfer);
    }
}
